home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / AppleScript / Additions / Wild 1.0.1 / project / C sources / wild.h < prev   
Encoding:
Text File  |  1994-05-09  |  3.9 KB  |  136 lines  |  [TEXT/KAHL]

  1. //    wild.h        wildcard AppleScript addition
  2. //
  3. //    93/11/17    File created
  4. //    93/12/08    *** released Wild 0.1.0 ***
  5. //    93/12/09    moved common files to the THINK C Folder
  6. //    94/01/24    *** released Wild 1.0.0 ***
  7. //    94/05/09    Totally removed the licensing mechanism and added the GNU comments
  8. //
  9. //--------------------------------------------------------------------------------------------------
  10. //  Copyright © 1993, 1994 by Rainbow Hill Pty Ltd.
  11. //
  12. //    This program is free software; you can redistribute it and/or modify it under the terms of
  13. //    the GNU General Public License as published by the Free Software Foundation; either version 2
  14. //    of the License, or any later version.
  15. //
  16. //    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  17. //    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. //    See the GNU General Public License for more details.
  19. //
  20. //    You should have received a copy of the GNU General Public License along with this program;
  21. //    if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. //
  23. #pragma once
  24.  
  25. #include <AppleEvents.h>
  26. #include <AERegistry.h>
  27.  
  28. #define WILD_name                    "Wild"
  29. #define WILD_bufferLength            256
  30. #define WILD_nameLength                64
  31. #define WILD_maxFilenameLen            31
  32.  
  33. //
  34. // resource related constants    *** must agree with resource IDs in wild.π.rsrc ***
  35. //
  36. #define WILD_genericDialogRsrc                128            // ALRT (and DITL)
  37. #define WILD_dlogRsrc                        129            // DLOG (and DITL)
  38.         enum {
  39.             WILD_dlogIconNo            = 1,
  40.             WILD_dlogOkNo            = 2,
  41.             WILD_dlogStopNo            = 3,
  42.             WILD_dlogRestoreNo        = 4,
  43.             WILD_dlogDefaultNo        = 5,
  44.             WILD_dlogDoCreatorNo    = 6,
  45.             WILD_dlogCreatorNo        = 7,
  46.             WILD_dlogDoTypeNo        = 8,
  47.             WILD_dlogTypeNo            = 9,
  48.             WILD_dlogDoLongNo        = 10,
  49.             WILD_dlogLongNo            = 11,
  50.             WILD_dlogDoShortNo        = 12,
  51.             WILD_dlogShortNo        = 13,
  52.             WILD_dlogFilesNo        = 14,
  53.             WILD_dlogFoldersNo        = 15,
  54.             WILD_dlogCaseNo            = 16,
  55.             WILD_dlogOnlyNameNo        = 17,
  56.             WILD_dlogOnlyNo            = 18,
  57.             WILD_dlogCopyrightNo    = 19,
  58.  
  59.             WILD_dlogItemArraySize
  60.             };
  61. #define WILD_errMessRsrc                    128            // STR#        error messages
  62.         enum {
  63.             WILD_wrongDataErrStr    = 1,
  64.             WILD_noStringErrStr        = 2,
  65.             WILD_dirParDataErrStr    = 3,
  66.             WILD_nothingErrStr        = 4,
  67.             WILD_badWildErrStr        = 5,
  68.             WILD_notFoundErrStr        = 6
  69.             };
  70. #define WILD_parmNamesRsrc                    129            // STR#        parameter names
  71.         enum {
  72.             WILD_longName        = 1,
  73.             WILD_shortName        = 2,
  74.             WILD_filesName        = 3,
  75.             WILD_foldersName    = 4,
  76.             WILD_creatorName    = 5,
  77.             WILD_typeName        = 6,
  78.             WILD_caseName        = 7,
  79.             WILD_dlogName        = 8,
  80.             WILD_onlyName        = 9
  81.             };
  82. #define WILD_miscStrRsrc                    130            // STR#        miscellaneous strings
  83.         enum {
  84.             WILD_itemStr        = 1,
  85.             WILD_OSErrStr        = 2,
  86.             WILD_copyright        = 3
  87.             };
  88.  
  89. //
  90. // IDs of paramaters of class 'rh??'    *** must agree with IDs of 'aete' in wild.π.rsrc ***
  91. //
  92. enum {
  93.     WILD_kAEfiles        = ((AEKeyword)'file'),
  94.     WILD_kAEfolders        = ((AEKeyword)'fold'),
  95.     WILD_kAEcase        = ((AEKeyword)'case'),
  96.     WILD_kAElong        = ((AEKeyword)'star'),
  97.     WILD_kAEshort        = ((AEKeyword)'mark'),
  98.     WILD_kAEcreator        = ((AEKeyword)'ficr'),
  99.     WILD_kAEtype        = ((AEKeyword)'fity'),
  100.     WILD_kAEdialog        = ((AEKeyword)'dlog'),
  101.     WILD_kAEonly        = ((AEKeyword)'only')
  102.     };
  103.  
  104. // default values for the parameters
  105. // Note that the default values for 'doCreator' and 'doType' are hardcoded to false.
  106. enum {
  107.     WILD_filesDef            = true,
  108.     WILD_foldersDef            = true,
  109.     WILD_caseDef            = false,
  110.     WILD_doLongDef            = true,
  111.     WILD_doShortDef            = true,
  112.     WILD_longDef            = '*',
  113.     WILD_shortDef            = '?',
  114.     WILD_dialogDef            = false
  115.     };
  116.  
  117. struct wild_parm_struct {
  118.     Boolean        files;
  119.     Boolean        folders;
  120.     Boolean        caseS;
  121.     Boolean        doLong;
  122.     Boolean        doShort;
  123.     Boolean        doCreator;
  124.     Boolean        doType;
  125.     Boolean        doDialog;
  126.     char        longW;
  127.     char        shortW;
  128.     OSType        creator;
  129.     OSType        type;
  130.     char        only[WILD_nameLength];
  131.     };
  132. typedef struct wild_parm_struct wild_parm_t;
  133.  
  134. // character to fill in creator and file type if less than 4 characters are specified
  135. #define WILD_defOSchar        '\0'
  136.